from typing import Any
from transformers import BertTokenizer, BertModel

tokenizer = BertTokenizer.from_pretrained("D:/bert-base-chinese")
model = BertModel.from_pretrained("D:/bert-base-chinese")


def EmbeddingText(text: str) -> Any:
    inputs = tokenizer(text, return_tensors="pt")
    outputs = model(**inputs)
    return outputs.last_hidden_state[:, 0, :].tolist()[0]
